home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / amos / AMOSL0495.lzh / AMOSLIST / 000107_svcs1.digex.net!amos-request_ Sat Apr 22 18:03:41 1995 remote from earth.msg < prev    next >
Internet Message Format  |  1995-05-01  |  3KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224]) by earth.usa.net (8.6.10/8.6.10) with SMTP id SAA23016 for <lee.kitchens@georgia.com>; Sat, 22 Apr 1995 18:03:41 -0600
  2. Received: by svcs1.digex.net id AA13317
  3.   (5.67b8/IDA-1.5 for amos-out); Sat, 22 Apr 1995 14:43:38 -0400
  4. Received: from nfs2.digex.net by svcs1.digex.net with SMTP id AA13313
  5.   (5.67b8/IDA-1.5 for <amos@svcs1.digex.net>); Sat, 22 Apr 1995 14:43:36 -0400
  6. Received: from goober.mbhs.edu by nfs2.digex.net with SMTP id AA08391
  7.   (5.67b8/IDA-1.5 for <amos-list@access.digex.net>); Sat, 22 Apr 1995 14:43:35 -0400
  8. Received: from dragon.mbhs.edu by goober.mbhs.edu (AIX 3.2/UCB 5.64/4.03)
  9.           id AA45252; Sat, 22 Apr 1995 14:45:20 -0400
  10. Date: Sat, 22 Apr 1995 14:45:20 -0400
  11. Message-Id: <9504221845.AA45252@goober.mbhs.edu>
  12. From: earth!dragon.mbhs.edu!achurch (Andy Church)
  13. To: earth!access.digex.net!amos-list
  14. Subject: Re: If vs On Proc
  15. Reply-To: earth!goober.mbhs.edu!achurch
  16. X-Mailer: MMail v4.21
  17. Status: O
  18. X-Status: 
  19.  
  20. >I was wondering about which of these three routines 
  21. >that are faster:
  22. >
  23. >1)
  24. >    ...
  25. >    MK=Mouse Key
  26. >    MC=Mouse Click
  27. >    If MC<>0
  28. >      If MC=2
  29. >        If MK=3
  30. >          ...
  31. >        Else
  32. >          ...
  33. >        End If
  34. >      Else
  35. >        If MK=3
  36. >          ...
  37. >        Else
  38. >          ...
  39. >        End If
  40. >    Else
  41. >      If MK=1
  42. >        ...
  43. >      Else
  44. >        ...
  45. >      End If
  46. >    End If
  47. >    ...
  48. >
  49. >
  50. >2)
  51. >    ...
  52. >    MK=Mouse Key
  53. >    MC=Mouse Click
  54. >    If MC=2 and MK=3 then ...
  55. >    If MC=2 and MK<>3 then ...
  56. >    If MC=1 and MK=3 then ...
  57. >    If MC=1 and MK<>3 then ...
  58. >    ...
  59. >
  60. >
  61. >3)
  62. >    ...
  63. >    MICE=Mouse Click
  64. >    Rol.b 2,MICE
  65. >    Add MICE,Mouse Key
  66. >    On MICE Proc ZIP,ZIP,ZIP,ZIP,MICE_5,ZIP,MICE_7,...
  67. >    ...
  68. >
  69. >All three has both good and bad sides,but
  70. >which one is faster?
  71.  
  72.   3 is fastest, then 1, then 2.
  73.  
  74. >I've heard that procedures should be avoided to make
  75. >routines faster.Is it true always or is it true only on
  76. >events like when a procedure is returning or receiving an
  77. >argument? 
  78.  
  79.   Well, then you've heard completely wrong.  Procedures should *never* be
  80. avoided; in fact, they should be utilized as much as possible to make your
  81. code more readable and modular.  It's true that not using procedures
  82. increases the speed of your code by a *very* small amount, but if you have
  83. something that's so speed-critical that you'd want to avoid even that
  84. overhead, you should be doing it in assembler anyway.
  85.  
  86.   --Andy Church (achurch@goober.mbhs.edu)
  87.     WWW: http://www.mbhs.edu/~achurch/
  88.     AMOS Web Site: http://www.mbhs.edu/~achurch/amos/
  89.